package org.example.service.impl;

import org.example.entity.District;
import org.example.mapper.DistrictMapper;
import org.example.service.IDistrictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 地区表 服务实现类
 * </p>
 *
 * @author 
 * @since 2025-05-09
 */
@Service
public class DistrictServiceImpl extends ServiceImpl<DistrictMapper, District> implements IDistrictService {

    @Autowired
    private DistrictMapper districtMapper;

    @Override
    public List<District> getRegionsByLevel() {
        return districtMapper.selectProvince();
    }

    @Override
    public List<District> getChildrenByParentName(int parentId,int level) {
        return districtMapper.findChildrenByParentName(parentId,level);
    }
}
